package com.ssy.lingxi.marketing.model.vo.coupon.request;

import lombok.Data;
import lombok.Getter;
import lombok.Setter;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * 活动商品价格和活动标签返回类
 * @author yzc
 * @version 2.0.0
 * @date 2021/9/1
 */
@Getter
@Setter
public class ActivityGoodsCartRequest implements Serializable {

    private static final long serialVersionUID = -4001769329159643964L;

    /**
     * 商城id
     */
    @NotNull(message = "商城id不能为空")
    private Long shopId;

    /**
     * 店铺
     */
    @NotNull(message = "店铺不能为空")
    @Valid
    private List<Store> storeList;


    @Data
    public static class Store implements Serializable {
        private static final long serialVersionUID = -5548893609367594632L;

        /**
         * 商品集合
         */
        @NotEmpty(message = "商品集合不能为空")
        @Valid
        private List<Goods> goodsList;
    }

    @Data
    public static class Goods implements Serializable {
        private static final long serialVersionUID = -7402423352154411015L;

        /**
         * 商品id
         */
        @NotNull(message = "商品id不能为空")
        private Long productId;

        /**
         * sku商品集合
         */
        @NotEmpty(message = "sku商品集合不能为空")
        @Valid
        private List<GoodsSku> goodsSkuList;
    }

    @Data
    public static class GoodsSku implements Serializable {
        private static final long serialVersionUID = -8093678174613920818L;
        /**
         * 品类id
         */
        @NotNull(message = "品类id不能为空")
        private Long categoryId;

        /**
         * 品牌id
         */
        private Long brandId;

        /**
         * skuId
         */
        @NotNull(message = "skuId不能为空")
        private Long skuId;

        /**
         * 单价
         */
        @NotNull
        private BigDecimal price;

        /**
         * 数量
         */
        @NotNull(message = "数量不能为空")
        private Integer quantity;
    }
}
